{% load i18n %}
{% load lfs_tags %}
<table class="lfs-default">
    <tr>
        <th colspan="2">
            {% trans 'Product' %}
        </th>
        <th class="number">
            {% trans 'Quantity' %}
        </th>
        <th class="number">
            {% trans 'Net Price' %}
        </th>
        <th class="number">
            {% trans 'VAT' %}
        </th>
        <th class="number last">
            {% trans 'Total' %}
        </th>
    </tr>
    {% for cart_item in cart_items %}
        <tr>
            <td class="image">
                <img src="{{ cart_item.product.get_image.image.url_60x60 }}"
                     alt="{{ cart_item.product.get_name }}"/>
            </td>
            <td>
                {{ cart_item.product.get_name }}
                {% for property in cart_item.product.get_variant_properties %}
                    <div>
                        {{ property.title }}: {{ property.value }} {{ property.unit|safe }}
                    </div>
                {% endfor %}

                {% for property in cart_item.product.get_displayed_properties %}
                    <div>
                        {{ property.title }}: {{ property.value }} {{ property.unit|safe }}
                    </div>
                {% endfor %}

                {% if cart_item.product.is_configurable_product %}
                    {% for property in cart_item.obj.get_properties %}
                        <div>
                            {{ property.title }}: {{ property.value }} {{ property.unit|safe }}
                            {% if property.obj.is_select_field and property.display_price %}
                                ({{ property.price|currency:request}})
                            {% endif %}
                        </div>
                    {% endfor %}
                {% endif %}

            </td>
            <td class="number">
                {{ cart_item.quantity }} {{ cart_item.product.get_unit }}
                {% if cart_item.product.get_active_packing_unit %}
                    <span class="packing-unit">
                        ({{ cart_item.obj|packages }} {{ cart_item.product.get_packing_info.1 }})
                    </span>
                {% endif %}

            </td>
            <td class="number">
                {{ cart_item.product_price_net|currency:request}}
            </td>
            <td class="number">
                {{ cart_item.product_tax|currency:request}}
            </td>
            <td class="number last">
                {{ cart_item.product_price_gross|currency:request}}
            </td>
        </tr>
    {% endfor %}
    <tr class="total">
        <td colspan="3"></td>
        <td colspan="3" class="number total">
            {% trans 'Total' %}: {{ total|currency:request}}
        </td>
    </tr>
</table>
